package com.resafety.rtsp2flv.controller.base;


import com.resafety.rtsp2flv.quartz.task.FlvMonitorTask;
import com.resafety.rtsp2flv.utils.AjaxResult;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gongl
 * @date 2023-03-22
 */
@RestController
@RequestMapping("/flv")
public class FlvController {
    @Autowired
    public FlvMonitorTask flvMonitorTask;

    @RequestMapping("/on_play")
    public AjaxResult on_play(HttpServletRequest request) {
        //鉴权，根据自己系统需要进行鉴权。返回200成功，返回其他失败
        
        //播放
        String stream = request.getParameter("stream");
        flvMonitorTask.openStream(stream);
        return  AjaxResult.success();
    }
}

